--PLT_SEC_USER_T
insert into PLT_SEC_USER_T (ID, NAME, DISPLAY_NAME, EMAIL, PHONE, EXPIRE_DATE, PASSWORD, SALT, ENABLED, DELETED, CREATE_DATE, CREATED_BY, LAST_UPDATE_DATE, LAST_UPDATED_BY)
values (-1, 'admin', 'admin', 'xxx@163.com', '13388888888', SYSDATE + 60, '5d88298fdcb085c2b8927702ec36b1aae8c28cbe7bb9743e522f63517a9e82c822e94194c976105b1567c531f97066cea14005069fca719fe25fa029288daee1', 'ba25e26c25ae4da47260d866e9f8586c', 1, 0, SYSDATE, -1, SYSDATE, -1);

--PLT_SEC_ROLE_T
insert into PLT_SEC_ROLE_T (SCOPE,ID, NAME,CREATE_DATE, CREATED_BY, LAST_UPDATE_DATE, LAST_UPDATED_BY)
values ('${application.scope}',-1, '系统管理员',SYSDATE, -1, SYSDATE, -1);

--PLT_SEC_PROGRAM_T
insert into PLT_SEC_PROGRAM_T (SCOPE,ID, NAME,CREATE_DATE, CREATED_BY, LAST_UPDATE_DATE, LAST_UPDATED_BY)
values ('${application.scope}',-1, '全部',SYSDATE, -1, SYSDATE, -1);

--PLT_SEC_PROGRAM_ITEMS_T
insert into PLT_SEC_PROGRAM_ITEMS_T (PROGRAM_ID, DIMENSION, VALUE)
values (-1, '__ALL__', '*');

--PLT_SEC_USER_ROLE_PROGRAM_T
--admin 系统管理员 全部
insert into PLT_SEC_USER_ROLE_PROGRAM_T (USER_ID, ROLE_ID, PROGRAM_ID)
values (-1, -1, -1);

--permission
insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'userManagement', 'page');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'userManagement', 'create');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'userManagement', 'update');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'userManagement', 'delete');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'userManagement', 'revert');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'userManagement', 'query');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'roleManagement', 'page');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'roleManagement', 'update');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'roleManagement', 'batch');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'roleManagement', 'delRoleCascade');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'roleManagement', 'create');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'roleManagement', 'query');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'permissionManage', 'page');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'permissionManage', 'saveRolePermissions');

insert into PLT_SEC_PERMISSION_T (APP_NAME,ID, R_CODE, O_CODE)
values ('${application.appName}',PLT_SEC_PERMISSION_S.NEXTVAL, 'permissionManage', 'findPermissionTree');

--role permission
insert into PLT_SEC_ACL_T (ROLE_ID, PERMISSION_ID)
select  -1 as role_id,
       id as permission_id
from PLT_SEC_PERMISSION_T;


























/*

--PLT_SEC_USER_T
insert into PLT_SEC_USER_T (ID, NAME, DISPLAY_NAME, EMAIL, PHONE, EXPIRE_DATE, PASSWORD, SALT, ENABLED, DELETED, CREATE_DATE, CREATED_BY, LAST_UPDATE_DATE, LAST_UPDATED_BY)
values (1, 'test1', 'test1', 'xxx@163.com', '13388888888', to_date('16-06-2018', 'dd-mm-yyyy'), '5d88298fdcb085c2b8927702ec36b1aae8c28cbe7bb9743e522f63517a9e82c822e94194c976105b1567c531f97066cea14005069fca719fe25fa029288daee1', 'ba25e26c25ae4da47260d866e9f8586c', 1, 0, to_date('07-06-2017', 'dd-mm-yyyy'), 0, to_date('07-06-2017', 'dd-mm-yyyy'), 0);

--PLT_SEC_ROLE_T
insert into PLT_SEC_ROLE_T (ID, NAME)
values (1, '部长');
insert into PLT_SEC_ROLE_T (ID, NAME)
values (2, '厅长');
insert into PLT_SEC_ROLE_T (ID, NAME)
values (3, '局长');
insert into PLT_SEC_ROLE_T (ID, NAME)
values (4, '科长');

--PLT_SEC_PROGRAM_T
insert into PLT_SEC_PROGRAM_T (ID, NAME)
values (0, '全部');
insert into PLT_SEC_PROGRAM_T (ID, NAME)
values (1, '中美-工农');
insert into PLT_SEC_PROGRAM_T (ID, NAME)
values (2, '巴基斯坦-农业');
insert into PLT_SEC_PROGRAM_T (ID, NAME)
values (3, '巴基斯坦-工业');
insert into PLT_SEC_PROGRAM_T (ID, NAME)
values (4, '俄罗斯-所有');

--PLT_SEC_PROGRAM_ITEMS_T
insert into PLT_SEC_PROGRAM_ITEMS_T (PROGRAM_ID, DIMENSION, VALUE)
values (0, '__ALL__', '*');
insert into PLT_SEC_PROGRAM_ITEMS_T (PROGRAM_ID, DIMENSION, VALUE)
values (1, 'LOCATION', '中国');
insert into PLT_SEC_PROGRAM_ITEMS_T (PROGRAM_ID, DIMENSION, VALUE)
values (1, 'LOCATION', '美国');
insert into PLT_SEC_PROGRAM_ITEMS_T (PROGRAM_ID, DIMENSION, VALUE)
values (1, 'BUSINESS', '工业');
insert into PLT_SEC_PROGRAM_ITEMS_T (PROGRAM_ID, DIMENSION, VALUE)
values (1, 'BUSINESS', '农业');
insert into PLT_SEC_PROGRAM_ITEMS_T (PROGRAM_ID, DIMENSION, VALUE)
values (2, 'LOCATION', '巴基斯坦');
insert into PLT_SEC_PROGRAM_ITEMS_T (PROGRAM_ID, DIMENSION, VALUE)
values (2, 'BUSINESS', '农业');
insert into PLT_SEC_PROGRAM_ITEMS_T (PROGRAM_ID, DIMENSION, VALUE)
values (3, 'LOCATION', '巴基斯坦');
insert into PLT_SEC_PROGRAM_ITEMS_T (PROGRAM_ID, DIMENSION, VALUE)
values (3, 'BUSINESS', '工业');
insert into PLT_SEC_PROGRAM_ITEMS_T (PROGRAM_ID, DIMENSION, VALUE)
values (4, 'LOCATION', '俄罗斯');

--PLT_SEC_USER_ROLE_PROGRAM_T
--test1 部长 中美-工农
insert into PLT_SEC_USER_ROLE_PROGRAM_T (USER_ID, ROLE_ID, PROGRAM_ID)
values (1, 1, 1);

--test1 厅长 中美-工农
insert into PLT_SEC_USER_ROLE_PROGRAM_T (USER_ID, ROLE_ID, PROGRAM_ID)
values (1, 2, 1);

--test1 厅长 巴基斯坦-工业
insert into PLT_SEC_USER_ROLE_PROGRAM_T (USER_ID, ROLE_ID, PROGRAM_ID)
values (1, 2, 3);

--test1 部长 俄罗斯-所有行业
insert into PLT_SEC_USER_ROLE_PROGRAM_T (USER_ID, ROLE_ID, PROGRAM_ID)
values (1, 1, 4);

--test1 部长 所有地区-所有行业
insert into PLT_SEC_USER_ROLE_PROGRAM_T (USER_ID, ROLE_ID, PROGRAM_ID)
values (1, 4, 0);

--permission
insert into PLT_SEC_PERMISSION_T (ID, R_CODE, O_CODE)
values (1, 'userManagement', 'create');

insert into PLT_SEC_PERMISSION_T (ID, R_CODE, O_CODE)
values (2, 'userManagement', 'update');

insert into PLT_SEC_PERMISSION_T (ID, R_CODE, O_CODE)
values (3, 'userManagement', 'delete');

insert into PLT_SEC_PERMISSION_T (ID, R_CODE, O_CODE)
values (4, 'userManagement', 'query');


--role permission
insert into PLT_SEC_ACL_T (ROLE_ID, PERMISSION_ID)
values (1, 1);

insert into PLT_SEC_ACL_T (ROLE_ID, PERMISSION_ID)
values (1, 2);

insert into PLT_SEC_ACL_T (ROLE_ID, PERMISSION_ID)
values (1, 4);
*/